#include "CReverseCommand.h"
#include "CUserInterface.h"
#include "CLevelEditor.h"

extern CGlobals* g;
extern CUserInterface* ui;
extern CLevelEditor* editor;

CReverseCommand::CReverseCommand (IDoUndoCommand* command)
{
	m_command = command;
	m_command->grab();
	setDescription(stringw(L"reverse ") + m_command->getDescription());
}

CReverseCommand::~CReverseCommand ()
{
	m_command->drop();
}

void CReverseCommand::redo ()
{
	m_command->undo();
}

void CReverseCommand::undo ()
{
	m_command->redo();
}

IDoUndoCommand* CReverseCommand::getReverse ()
{
	m_command->grab();
	return m_command;
}
